#include "AppDelegate.h"
#include "HelloWorldScene.h"
#include "GameUtils/ADUGameManager.h"
#include "GameUtils/ADUConstants.h"

CCSize AppDelegate::designResolutionSize = CCSizeMake(768, 1280);

AppDelegate::AppDelegate() {

}

AppDelegate::~AppDelegate() {
}

bool AppDelegate::applicationDidFinishLaunching() {

	CCDirector* pDirector = CCDirector::sharedDirector();
	CCEGLView* pEGLView = CCEGLView::sharedOpenGLView();

	pDirector->setOpenGLView(pEGLView);

	pEGLView->setDesignResolutionSize(designResolutionSize.width,
			designResolutionSize.height, kResolutionExactFit);

	pDirector->setDisplayStats(false);

	pDirector->setAnimationInterval(1.0 / 60);

	//CCScene *pScene = HelloWorld::scene();
	//pDirector->runWithScene(pScene);

	ADUGameManager::getInstance()->RunScene(SCENE_START);

	return true;
}

void AppDelegate::applicationDidEnterBackground() {
	CCDirector::sharedDirector()->stopAnimation();
//    SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();
}

void AppDelegate::applicationWillEnterForeground() {
	CCDirector::sharedDirector()->startAnimation();
//    SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic();
}
